package com.greenantmall.bean;

import java.util.Date;

import com.avos.avoscloud.AVACL;
import com.avos.avoscloud.AVClassName;
import com.avos.avoscloud.AVObject;

@AVClassName(AntAVObject.CLASS_EMRECV)
public class EMRecv extends AntAVObject {
	public static final String ATTR_ORDERID = "orderId";
	public static final String ATTR_EMID = "EMId";
	public static final String ATTR_EMCODE = "EMCode";
	public static final String ATTR_STATUS = "status";
	public static final String ATTR_SINGER = "singer";
	public static final String ATTR_CREATEDAT = "createdAt";
	public static final String ATTR_SINGEDTIME = "SingedTime";
	public static final String ATTR_USERID = "userId";
	public static final String ATTR_STORE = "store";
	public static final String ATTR_EMCOMPANY = "EMCompany";
	public static final String ATTR_SENDERNAME = "senderName";
	public static final String ATTR_SENDERPHONE = "senderPhone";
	public static final String ATTR_SENDERADDR = "senderAddr";
	public static final String ATTR_RECEIVERNAME = "receiverName";
	public static final String ATTR_RECEIVERPHONE = "receiverPhone";
	public static final String ATTR_RECEIVERADDR = "receiverAddr";

	private StoreInfo mStoreInfo;
	private EMCompany mEMCompany;

	public EMRecv() {
		super();
		setAccessCtrl();
	}

	public EMRecv(String str) {
		super(str);
		setAccessCtrl();
	}

	public String getOrderId() {
		String orderId = this.getString(ATTR_ORDERID);
		return (orderId == null ? "" : orderId);
	}

	public void setOrderid(String orderId) {
		this.put(ATTR_ORDERID, orderId);
	}

	public String getEMId() {
		String emId = this.getString(ATTR_EMID);
		return (emId == null ? "" : emId);
	}

	public void setEMId(String emId) {
		this.put(ATTR_EMID, emId);
	}

	public String getEMCode() {
		String emCode = this.getString(ATTR_EMCODE);
		return (emCode == null ? "" : emCode);
	}

	public void setEMCode(String emCode) {
		this.put(ATTR_EMCODE, emCode);
	}

	public int getStatus() {
		return this.getInt(ATTR_STATUS);
	}

	public void setStatus(int status) {
		this.put(ATTR_STATUS, status);
	}

	public String getSinger() {
		String singer = this.getString(ATTR_SINGER);
		return (singer == null ? "" : singer);
	}

	public void setSinger(String singer) {
		this.put(ATTR_SINGER, singer);
	}

	public Date getSingedTime() {
		Date date = this.getDate(ATTR_SINGEDTIME);
		return date;
	}

	public void setSingedTime(Date date) {
		this.put(ATTR_SINGEDTIME, date);
	}

	public String getUserId() {
		String userId = this.getString(ATTR_USERID);
		return (userId == null ? "" : userId);
	}

	public void setUserId(String userId) {
		this.put(ATTR_USERID, userId);
	}

	public StoreInfo getStore() {
		return mStoreInfo;
	}

	public void setStore(StoreInfo storeInfo) {
		this.mStoreInfo = storeInfo;
	}

	public EMCompany getEMCompany() {
		return mEMCompany;
	}

	public void setEMCompany(EMCompany emCompany) {
		this.mEMCompany = emCompany;
	}

	public String getSenderName() {
		String senderName = this.getString(ATTR_SENDERNAME);
		return (senderName == null ? "" : senderName);
	}

	public void setSenderName(String senderName) {
		this.put(ATTR_SENDERNAME, senderName);
	}

	public String getSenderPhone() {
		String senderPhone = this.getString(ATTR_SENDERPHONE);
		return (senderPhone == null ? "" : senderPhone);
	}

	public void setSenderPhone(String senderPhone) {
		this.put(ATTR_SENDERPHONE, senderPhone);
	}

	public String getSenderAddr() {
		String senderAddr = this.getString(ATTR_SENDERADDR);
		return (senderAddr == null ? "" : senderAddr);
	}

	public void setSenderAddr(String senderAddr) {
		this.put(ATTR_SENDERADDR, senderAddr);
	}

	public String getReceiverName() {
		String receiverName = this.getString(ATTR_RECEIVERNAME);
		return (receiverName == null ? "" : receiverName);
	}

	public void setReceiverName(String receiverName) {
		this.put(ATTR_RECEIVERNAME, receiverName);
	}

	public String getReceiverPhone() {
		String receiverPhone = this.getString(ATTR_RECEIVERPHONE);
		return (receiverPhone == null ? "" : receiverPhone);
	}

	public void setReceiverPhone(String receiverPhone) {
		this.put(ATTR_RECEIVERPHONE, receiverPhone);
	}

	public String getReceiverAddr() {
		String receiverAddr = this.getReceiverAddr();
		return (receiverAddr == null ? "" : receiverAddr);
	}

	public void setReceiverAddr(String receiverAddr) {
		this.put(ATTR_RECEIVERADDR, receiverAddr);
	}

	private int setAccessCtrl() {
		acl = new AVACL();
		acl.setPublicReadAccess(true);
		acl.setPublicWriteAccess(true);
		return 0;
	}

}
